import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';

export class CreateOrganizationAdminReqDto {
  @ApiProperty({ description: '上级组织Uuid' })
  @IsNumber({}, { message: '上级组织编号格式不正确' })
  readonly parent_id: number;

  @ApiProperty({ description: '组织名称' })
  @IsNotEmpty({ message: '组织名称不能为空' })
  @IsString({ message: '组织名称格式不正确' })
  readonly name: string;

  @ApiProperty({ description: '组织描述', required: false })
  @IsString({ message: '组织描述格式不正确' })
  @IsOptional()
  readonly description: string;
}
